package com.wc.AlgoOJ._快速幂.超大斐波那契数列;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/10/11 15:06
 * @description http://43.138.190.70:8888/p/MA0108
 */
public class Main {
    /**
     * F[n - 1] = {f[n - 1], f[n]}, F[n] = {f[n], f[n + 1]}
     * F[n - 1] * A = F[n]
     * A = {{0, 1}, {1, 1}}
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 2, P = (int) 1e9 + 7;

    public static void main(String[] args) {
        int T = sc.nextInt();
        while (T-- > 0) {
            long[][] f = {{0, 1}, {0, 0}}, A = {{0, 1}, {1, 1}};
            long k = sc.nextLong();
            A = qmi(A, k);
            mul(f, f, A);
            out.println(f[0][0]);
        }
        out.flush();
    }

    static long[][] qmi(long[][] a, long k) {
        long[][] res = getE();
        while (k > 0){
            if ((k & 1) == 1) mul(res, res, a);
            mul(a, a, a);
            k >>= 1;
        }
        return res;
    }

    static long[][] getE() {
        return new long[][]{{1, 0}, {0, 1}};
    }

    static void mul(long[][] c, long[][] a, long[][] b) {
        long[][] tmp = new long[N][N];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                for (int k = 0; k < N; k++) {
                    tmp[i][j] = (tmp[i][j] + a[i][k] * b[k][j]) % P;
                }
            }
        }
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                c[i][j] = tmp[i][j];
            }
        }
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
